import { isEmptyString } from "./utils"

/**
 * App 传过来的接口入参
 */
export default class AppParams {
    /** 广告id */
    static advertId = ""

    /** 安卓id */
    static androidId = ""

    /** token */
    static token = ""

    /** userId */
    static userId = ""

    /** mobile */
    static mobile = ""

    /** appVersion */
    static appVersion = ""

    /** product */
    static product = ""

    /** referrer */
    static referrer = ""

    /** chatName */
    static chatName = ""

    /** name */
    static name = ""

    /** 判断是否具备接口调用资格 */
    static isLogin() {
        let hasToken = !isEmptyString(this.token)
        return hasToken
    }

    /** 打印输出 */
    static printlog() {
        console.log("=======接收链接传过来的参数：")
        console.log("=======product: " + AppParams.product)
        console.log("=======advertId: " + AppParams.advertId)
        console.log("=======androidId: " + AppParams.androidId)
        console.log("=======token: " + AppParams.token)
        console.log("=======mobile: " + AppParams.mobile)
        console.log("=======userId: " + AppParams.userId)
        console.log("=======appVersion: " + AppParams.appVersion)
        console.log("=======referrer: " + AppParams.referrer)
        console.log("=======chatName: " + AppParams.chatName)
        console.log("=======name: " + AppParams.name)
    }
}